﻿using System.Web;
using System.Web.Routing;
using ManagedUIFlow.Application;
using Moq;
using Xunit;

namespace ManagedUIFlow.Specs.Application
{
    public class AppRouteHandlerSpecs
    {
        [Fact]
        public void GetHttpHandlerReturnsMvcHandlerWithRouteData()
        {
            var context = new RequestContext(new Mock<HttpContextBase>().Object, new RouteData());
            IRouteHandler rh = new AppRouteHandler();

            var httpHandler = rh.GetHttpHandler(context);

            var h = httpHandler as AppHandler;
            Assert.NotNull(h);
            Assert.Equal(context, h.RequestContext);
        }
    }
}
